package javaIO;

import nu.xom.*;

import java.util.ArrayList;

public class People extends ArrayList<Person> {
    public People(String filename) throws Exception{
        Document doc = new Builder().build(filename);
        Elements elements = doc.getRootElement().getChildElements();
        for (int i = 0;i < elements.size();i ++){
            add(new Person(elements.get(i)));
        }
    }

    public static void main(String[] args) throws Exception{
        People p = new People("People.xml");
        System.out.println(p);
    }
}
